/**
 * 
 */
package sk.gtug.googleek.client.presenter;

import sk.seges.acris.mvp.AbstractDisplayAwareActivity;

import com.google.gwt.event.shared.EventBus;
import com.google.gwt.user.client.ui.AcceptsOneWidget;
import com.google.gwt.user.client.ui.IsWidget;

/**
 * @author ladislav.gazo
 */
public class HomePresenter extends AbstractDisplayAwareActivity<HomePresenter.HomeDisplay> {
	public interface HomeDisplay extends IsWidget {
		AcceptsOneWidget getLeft();
	}

	private final UpcomingActivitiesPresenter activitiesPresenter;

	public HomePresenter(HomeDisplay display,
			UpcomingActivitiesPresenter activitiesPresenter) {
		super(display);
		this.activitiesPresenter = activitiesPresenter;
	}


	@Override
	public void start(AcceptsOneWidget panel, EventBus eventBus) {
		panel.setWidget(display.asWidget());
		activitiesPresenter.start(display.getLeft(), eventBus);
	}
	
	@Override
	public void onStop() {
		activitiesPresenter.onStop();
		super.onStop();
	}
}
